<include file="Public:header" />
<div class="container main"> <include file="Public:left" />
<script>
	//更新排序
	function update_weixin_sort(){
		var data=new Array();
		$("input[name='id']").each(function(index, element) {
            data.push($(this).val()+'_'+$(this).parent().parent().find("input[name='weixin_sort']").val());
        });
		$.post("{:U('doweixin_sort')}",{'sort':data.toString()},function(data){
			if(data=='OK'){
				alert('更新成功');
			}
		});
	}
</script>
  <div class="w790">
  <div class="h"><a href="{:U('add')}" class="btn btn-info"><i class="glyphicon glyphicon-plus"></i>添加数据</a></div>
     <div class="table_"><table class="table table-bordered" width="100%" border="0" cellspacing="0" cellpadding="0">
 <thead>
 <tr>
    <td height="21" align="center">ID</td>
    <td align="center">分类名</td>
    <td align="center">状态</td>
    <td align="center">排序</td>
    <td align="center">操作</td>
  </tr>
</thead>
<volist name="list" id="vo">
  <tr class="data_list">
    <td align="center"><input type="checkbox" name="id" id="id" class="sall" value="{$vo.id}" /></td>
    <td style="text-indent:{$vo['cl']*10}px"><gt name="vo['cl']" value="0">|-</gt><a href="__APP__/{$siteid}/{$vo.name}" target="_blank">{$vo.title}</a></td>
    <td align="center"><eq name="vo['status']" value="1"><span class="status1 status_btn" field="status,{$vo.id}"></span><else/><span class="status0 status_btn" field="status,{$vo.id}"></span></eq></td>
    <td align="center"><input name="sort" width="30" type="text" value="{$vo.sort}" size="4" /><a href="javascript:void(0);" onclick="update_sortClick('id','up',this,'sort','{:U('dosort')}');">上</a><a href="javascript:void(0);" onclick="update_sortClick('id','',this,'sort','{:U('dosort')}');">下</a></td>
    <td align="center"><a href="{:U('add',array('id'=>$vo['id']))}">添加子级</a> | <a href="{:U('edit',array('id'=>$vo['id']))}" title="编辑" class="editbtn">编辑</a> | <a href="{:U('delete',array('id'=>$vo['id']))}" onclick="return confirm('您确定要删除这条记录吗？');" class="delbtn" title="删除">删除</a></td>
  </tr>


       <volist name="vo['sub']" id="svo">
       	<tr class="data_list">
          <td align="center"><input type="checkbox" name="id" id="id" class="sall" value="{$svo.id}" /></td>
          <td style="text-indent:{$svo['deep']*20}px"><gt name="svo['deep']" value="0">|-</gt><a href="__APP__/{$siteid}/{$vo.name}" target="_blank">{$svo.title}</a></td>
          <td align="center"><eq name="svo['status']" value="1"><span class="status1 status_btn" field="status,{$svo.id}"></span><else/><span class="status0 status_btn" field="status,{$svo.id}"></span></eq></td>
    <td align="center"><input name="sort" width="30" type="text" value="{$svo.sort}" size="4" /><a href="javascript:void(0);" onclick="update_sortClick('id','up',this,'sort','{:U('dosort')}');">上</a><a href="javascript:void(0);" onclick="update_sortClick('id','',this,'sort','{:U('dosort')}');">下</a></td>
          <td align="center"><a href="{:U('add',array('id'=>$svo['id']))}">添加子级</a> | <a href="{:U('edit',array('id'=>$svo['id']))}" class="editbtn">编辑</a> | <a href="{:U('delete',array('id'=>$svo['id']))}" onclick="return confirm('您确定要删除这条记录吗？');" class="delbtn">删除</a></td>
        </tr>
       </volist>
</volist>
  
</table></div>
<div class="pages">
        <div class="controlList fl"><a href="javascript:void(0);" class="btn btn-primary btn-sm" onclick="sall();"><i class="glyphicon glyphicon-check"></i> 全选/反选</a> <a href="javascript:void(0);" class="btn btn-primary btn-sm" onclick="rall();"><i class="glyphicon glyphicon-unchecked"></i> 全不选</a> <a class="btn btn-danger btn-sm" href="javascript:void(0);" onclick="delall();"><i class="glyphicon glyphicon-trash"></i> 删除选中</a> <a href="javascript:void(0);" class="btn btn-primary btn-sm" onclick="update_sort('id','sort','','{:U('dosort')}');"><i class="glyphicon glyphicon-refresh"></i> 更新排序</a> <a href="javascript:void(0);" class="btn btn-primary btn-sm" onclick="update_weixin_sort();"><i class="glyphicon glyphicon-refresh"></i>更新排序(微信)</a>
        
          <input type="hidden" name="category_id" value="{$category_id}" />
          <input type="hidden" name="keywords" value="{$keywords}" />
        </form>
        <div class="fr">{$pages}</div>
    </div>
  </div>
  <div class="clear"></div>
</div>
</body></html>